require(['./config'], () => {
  require(['template', 'request', 'url','header'], (template, request, url) => {
  
  //引入的
  class Index {
      constructor () {
        this.getCategory()
        this.getBrandInfo()
      }
      getCategory () {
        // 颗粒度
        $.get('/libs/json/homeCategory.json', resp => {
          this.renderCategory(resp)
        })
      }

      renderCategory (list) {
        // const html = template('categoryTemplate', { 'list': list, cate: "饰品" })
        const html = template('categoryTemplate', { list })
        $('#categoryList').html(html)
      }

      getBrandInfo () {
        $.get(`${url.rap2BaseUrl}/brand/get`, resp => {
          if (resp.code === 200) {
            const { list } = resp.body
            // this.renderB(list)
            $('#brandInfoList').html(template('brandInfoTemplate', { list }))
          }
        })
      }
      
    }
    new Index()
  })
   require(['footer'], () => {
  
  })
  
})
